package com.yixin.hospital.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

import java.util.Objects;

@Getter
@AllArgsConstructor
public enum BusinessEnum {
    PURCHASE_ORDER("purchase_order", "采购单"),
    REGISTER("register", "注册"),
    APPLY_TMP_DEPT("apply_tmp_dept", "申请临时部门"),

    ;

    private final String code;
    private final String msg;

    public static String getDesc(String code) {
        for (BusinessEnum businessEnum : BusinessEnum.values()) {
            if (Objects.equals(businessEnum.getCode(), code)) {
                return businessEnum.getMsg();
            }
        }
        return "";
    }
}

